from html import escape
from web import DB

class User(DB.Model):
    """User表"""

    __tablename__ = 'src_user'
    username = DB.Column(DB.String(20), primary_key=True)
    password = DB.Column(DB.String(128), nullable=False)
    phone = DB.Column(DB.String(20))
    email = DB.Column(DB.String(50))
    remark = DB.Column(DB.Text)

    def __init__(self, username, password, phone, email, remark):
        self.username = escape(username)
        self.password = escape(password)
        self.phone = escape(phone)
        self.email = escape(email)
        self.remark = escape(remark)